package com.esms.service.impl;

import java.util.List;

import com.esms.po.Fassessment;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.esms.dao.DepartmentMapper;
import com.esms.dao.EmployeeMapper;
import com.esms.dao.SatisfactionMapper;
import com.esms.po.Gassessment;
import com.esms.po.Satisfaction;
import com.esms.service.IEmployeeSatisfactionServer;

@Service
public class EmployeeSatisfactionServerImpl implements IEmployeeSatisfactionServer {
	@Autowired
    private SatisfactionMapper satisfactionMapper = null;
	@Autowired
    private EmployeeMapper employeeMapper = null;
	@Autowired
    private DepartmentMapper departmentMapper = null;
	
    @Override
	public List<Satisfaction> getEmployeeSatisfactionList(String eId,int FdId, String fEid,String eName,String quarter) {
    	if(FdId == 0) {
    		return satisfactionMapper.selectBypIdAnddId(eId, fEid,eName,quarter);
    	}else {
    		return satisfactionMapper.selectBypIdAnddIdAndfEid(eId,FdId,fEid,eName,quarter);
    	}
	}
    
    @Override
    public int updateSatisfactionList(Satisfaction satisfaction) {
         return  satisfactionMapper.updateBysId(satisfaction); 
    
    }
    
    @Override
    public int deleteSatisfaction(String aAuserid , String aDuserid,String quarter) {
         return  satisfactionMapper.deleteSatisfaction(aAuserid, aDuserid,quarter);
    
    }
    @Override
    public int addgassessList(@Param("emps") List<Gassessment> gassessList) {
        return  satisfactionMapper.addgassList(gassessList);

    }
    @Override
    public int insertSatisfaction(Gassessment gassessment) {
         return  satisfactionMapper.insertSatisfaction(gassessment); 
    
    }
    public List<String> getDBaccount() {
    	return satisfactionMapper.selectByStat(2,1);
    }
}
